#!/bin/bash
for n in {1..10};do
      ping -c 2 192.168.89.$n &>/dev/null
      if [ $? -eq 0 ];then
           echo "192.168.89.$n 是在线的"
      else
           echo "192.168.89.$n 是不在线的"
      fi
done